#include "../include/CDefaultEnemyBehaviour.h"
#include "../include/CDefaultShotBehaviour.h"
#include "../include/CBombShotBehaviour.h"
#include "../include/CSpriteAnimation.h"

#include <SDL/SDL.h>

//**************************
//Description : Constructor
//Parameters : Value for m_iX, m_iY,
//              m_iSpeedX, m_iSpeedY,
//              m_iWidth, m_iHeight,
//              the ratio for the collision box
//              the type of colision
//              m_iLives
//              m_iNbPoints
//Note : None
//**************************
CDefaultEnemyBehaviour::CDefaultEnemyBehaviour(int _iX, int _iY,
                                                int _iSpeedX, int _iSpeedY,
                                                int _iWidth, int _iHeight,
                                                float _fRatioW, float _fRatioH,
                                                TYPE_COLLISION _iTypeCollision,
                                                int _iLives,
                                                int _iNbPoints)
    : IMovableEntityBehaviour(_iX, _iY,
                                _iSpeedX, _iSpeedY,
                                _iWidth, _iHeight,
                                _fRatioW, _fRatioH,
                                _iTypeCollision,
                                _iLives),
    m_iNbPoints(_iNbPoints)
{
    //this enemy doesn't shoot
    m_iPrimaryShot = -1;
    m_iSecondaryShot = -1;

    m_iTimeBetweenPrimaryShot = -1;
    m_iTimeBetweenSecondaryShot = -1;
}

//**************************
//Description : Copy Constructor
//Parameters : A CDefaultEnemyBehaviour
//Note : None
//**************************
CDefaultEnemyBehaviour::CDefaultEnemyBehaviour(CDefaultEnemyBehaviour & _DefaultEnemy)
    : IMovableEntityBehaviour(_DefaultEnemy),
    m_iNbPoints(_DefaultEnemy.m_iNbPoints)
{
}

//**************************
//Description : Destructor
//Parameters : None
//Note : None
//**************************
CDefaultEnemyBehaviour::~CDefaultEnemyBehaviour()
{
}

//**************************
//Description : Return the number of points that the player gain
//Parameters : None
//Return Value : m_iNbPoints
//Note : None
//**************************
int CDefaultEnemyBehaviour::GetPoints() const
{
    return m_iNbPoints;
}

//**************************
//Description : The entity shoot
//Parameters : The tab of animations shot and the screen
//Return Value : True if the enemy has shot, otherwise false
//Note : Virtual because the way of shooting depends on the entity
//**************************
bool CDefaultEnemyBehaviour::Shoot(CSpriteAnimation * _SpriteAnimationShot, SDL_Surface * _screen)
{
    return false;
}

//**************************
//Description : Update the trajectory of the entity
//Parameters : None
//Return Value : None
//Note : Virtual because actions depends on the entity type
//**************************
void CDefaultEnemyBehaviour::EntityTrajectory()
{
    m_iY += m_iSpeedY;
}
